import { Routes,RouterModule } from "@angular/router";
import { NgModule } from "@angular/core";
import { HomeComponent } from "./home/home.component";
import { TestComponent } from "./test/test.component";
import { MyProloadingStrategy } from "../common/my-proloading-strategy";
import { MyAuthGuard } from "../common/my-auth-guard";


export const routes : Routes = [
    {
		path: '',
		component: HomeComponent,	
		canActivate: [MyAuthGuard], 
		canLoad: [MyAuthGuard],
		children: [
			// { path: '', redirectTo: 'test', pathMatch: 'full' },
			// { path: 'test', component: TestComponent },
			
			{ path: "", redirectTo: "dashboard", canLoad: [MyAuthGuard],canActivate: [MyAuthGuard], pathMatch: "full" },
			{ path: "test", component: TestComponent },
			{ path: "dashboard", canLoad: [MyAuthGuard], canActivate: [MyAuthGuard], loadChildren: "../dashboard/dashboard.module#DashboardModule" },
			{ path: "user", canLoad: [MyAuthGuard], canActivate: [MyAuthGuard], loadChildren: "../user/user.module#UserModule" }
            
			// { path: 'inventory', loadChildren: '../../bz-modules/inventory/inventory.module#InventoryModule' },
			// { path: 'basic-data', loadChildren: '../../bz-modules/basic-data/basic-data.module#BasicDataModule' },
			// { path: 'sys', loadChildren: '../../bz-modules/sys/sys.module#SysModule' }
		]
	}
]

@NgModule({
	imports: [RouterModule.forChild(routes)],
	
    exports: [RouterModule]
})
export class HomeRoutes {}